package com.example.ruleenginelearning.example.rules;

import com.example.ruleenginelearning.example.engine.OrderRule;
import com.example.ruleenginelearning.example.model.Order;

public class ProcessingOrderRule implements OrderRule {

    @Override
    public boolean evaluate(Order order) {
        return "PROCESSING".equals(order.getStatus());
    }

    @Override
    public void execute(Order order) {
        System.out.print("处理中的订单: " + order.getId() +
                " | 商品数: " + order.getItemCount());

        if (order.getItemCount() > 5) {
            System.out.println(" → 大额订单，优先处理");
        } else {
            System.out.println(" → 普通订单处理");
        }

        order.setStatus("SHIPPED");
    }
}
